package com.waar.kickball.model;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Craig McIlwee
 * Copyright Lance + Craig 2013
 */
@Entity
@Table(name = "at_bat")
public class AtBat extends KickballEntity {

	@ManyToOne(optional = false)
	@JoinColumn(name = "kicker_id", nullable = false)
	private Player kicker;
	
	@ManyToOne
	@JoinColumn(name = "frame_id")
	private Frame frame;
	
	AtBat() { }
	
	/**
	 * @param kicker for this at bat
	 */
	public AtBat(Player kicker) {
		this.kicker = kicker;
	}
	
	/**
	 * @return the kicker
	 */
	public Player getKicker() {
		return kicker;
	}
	
	/**
	 * @return the frame
	 */
	public Frame getFrame() {
		return frame;
	}

	/**
	 * @param frame to set
	 */
	public void setFrame(Frame frame) {
		this.frame = frame;
	}
	
}
